<%@page import="edu.uta.tsrh.model.FileDetail"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
<%
    FileDetail fileDetail = (FileDetail) request.getAttribute("fileDetail");
    String historyUrl = "/TSRH/filetracking/file/historypage.org?fileId=" + fileDetail.getFileID();
    String pendingDatesUrl = "/TSRH/filetracking/file/pendingdatespage.org?fileId=" + fileDetail.getFileID();
    String checkoutUrl = "/TSRH/filetracking/file/checkoutpage.org?fileId=" + fileDetail.getFileID();
    String checkinUrl = "/TSRH/filetracking/file/checkinpage.org?fileId=" + fileDetail.getFileID();
    String transferUrl = "/TSRH/filetracking/file/transferpage.org?fileId=" + fileDetail.getFileID();
    String patientName = fileDetail.getPatientFirstName() + " " + fileDetail.getPatientLastName();
    String checkout = "disabled=\"disabled\"";
    String checkin = "disabled=\"disabled\"";
    String transfer = "disabled=\"disabled\"";
    if (fileDetail.getFileState().equals("OUT")) {
        checkin = "enabled=\"enabled\"";
        transfer = "enabled=\"enabled\"";
    } else {
        checkout = "enabled=\"enabled\"";
    }
%>	
<div class="box" style="width:500px;background-color: #F0F0F0;">
    <form action="<%=historyUrl%>" method="post">
        <input type="submit" value="History"  class="blue button" style="float:right"/>
    </form>
    <form action="<%=pendingDatesUrl%>" method="post">
        <input type="submit" value="Pending Dates" class="blue button" style="float:right"/>
    </form>				

    <h2>File details:</h2>	
    <table>	
        <tr>
            <td width="150"><h3>File ID:</h3></td>
            <td><h3><b><%= fileDetail.getFileID()%></b></h3></td>
        </tr>
        <tr>
            <td><h3>Patient Name:</h3></td>
            <td><h3><b><%= patientName%></b></h3></td>
        </tr>	 
        <tr>
            <td><h3>Date of Birth:</h3></td>
            <td><h3><b><%=fileDetail.getPatientDateOfBirth()%></b></h3></td>
        </tr>
        <tr>
            <td><h3>Location:</h3></td>
            <td><h3><b><%=fileDetail.getLocation()%></b></h3></td>
        </tr>
        <tr>
            <td><h3>Status:</h3></td>
            <td><h3><b><%=fileDetail.getFileState()%></b></h3></td>
        </tr>
    </table>		 
    <form action="<%=checkoutUrl%>" method="post" style="display:inline">				
        <input type="submit" class="blue button" value="Checkout" <%=checkout%>/>
    </form>
    <form action="<%=checkinUrl%>" method="post" style="display:inline">
        <input type="submit" class="blue button" value="Checkin" <%=checkin%>/>
    </form>
    <form action="<%=transferUrl%>" method="post" style="display:inline">			
        <input type="submit" class="blue button" value="Transfer" <%=transfer%>/>
    </form>
</div>

